package com.study.hot.jetpack.lifecycle

import android.os.Bundle
import android.os.SystemClock
import android.util.Log
import androidx.appcompat.app.AppCompatActivity
import com.study.hot.R
import kotlinx.android.synthetic.main.activity_lifecycle.*


class UselifecycleActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_lifecycle)

        // 添加生命周期观察者
        lifecycle.addObserver(LocListener())
    }


    override fun onStart() {
        super.onStart()
        Log.i("fauks","Activity onStart")
    }

    //不在当前页面暂停记时
    override fun onStop() {
        super.onStop()
        Log.i("fauks","Activity onStop")
    }
}